package com.ibeetl.eval;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class EvalEngineTest {
	
	
	public static void main(String[] args) throws Exception {
		testScript();

	}
	public static void testScript() throws Exception{
		
		EvalEngine engine = new EvalEngine();
		Map<String,Object> paras = new HashMap<String,Object>();
		paras.put("上访次数", 2);
		InputStream ins = EvalEngineTest.class.getResourceAsStream("/sample/simple002.xml");
		InputStreamReader reader = new InputStreamReader(ins,"utf8");
		Object ret = engine.run(reader, paras);
		System.out.println(ret);
	}
	public static void testEval() throws Exception{
			
		EvalEngine engine = new EvalEngine();
		Map<String,Object> paras = new HashMap<String,Object>();
		paras.put("每月收入", 178832323.12);
		paras.put("每月负债", 128.99);
		InputStream ins = EvalEngineTest.class.getResourceAsStream("/sample/simple001.xml");
		InputStreamReader reader = new InputStreamReader(ins,"utf8");
		Object ret = engine.run(reader, paras);
		System.out.println(ret);
	}
	
	

}
